}
},
+ _maybeCancelDialog: function() {
+ if (!this._dialog)
+ return;
+
+ this._dialog.cancel();
+ if (this._isGreeter) {
+ // LoginDialog.cancel() will grab the key focus
+ // on its own, so ensure it stays on lock screen
+ // instead
+ this._lockScreenGroup.grab_key_focus();
+ } else {
+ this._dialog = null;
+ }
+ },
+
_becomeModal: function() {
if (this._isModal)
return true;
onCompleteScope: this,
});
- // If we have a unlock dialog, cancel it
- if (this._dialog) {
- this._dialog.cancel();
- if (!this._isGreeter) {
- this._dialog = null;
- }
- }
+ this._maybeCancelDialog();
}
},
if (status != GnomeSession.PresenceStatus.IDLE)
return;
- if (this._dialog) {
- this._dialog.cancel();
- if (!this._isGreeter) {
- this._dialog = null;
- }
- }
+ this._maybeCancelDialog();
if (this._lightbox.actor.visible ||
this._isActive) {